import java.util.Scanner;

public class Main1090 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        for (int i=10;i<1001;i++){
            if (i%2==0&&i%3==0&&i%7==0){
                System.out.println(i);
            }
        }
    }
}
